#pragma once

#include "vrdatacore_global.h"
#include "drawableactor.h"
#include <osg\ShapeDrawable>
#include <osg/PositionAttitudeTransform>
#include <osg/StateSet>

namespace VrDataCore
{
	class VRDATACORE_EXPORT FreeSurroundBoxActor:public DrawableActor
	{
	public:
		FreeSurroundBoxActor(void);
	protected:
		virtual ~FreeSurroundBoxActor(void);
		virtual void createDrawable();
		virtual void initialNode();
		void initStateValue();
		QString											_vertexString;
		osg::ref_ptr<osg::Box>							_pBox;
		osg::ref_ptr<osg::ShapeDrawable>				_shapeDrawable;
		osg::ref_ptr<osg::Geode>						_geode;
		osg::ref_ptr<osg::PositionAttitudeTransform>	_transformNode;
		osg::Vec3										_minVertex;
		osg::Vec3										_maxVertex;
		int												_state;
		osg::ref_ptr<osg::StateSet>						_ss;
	public:
		virtual void buildPropertyMap();
		virtual void onMapLoadEnd(CoreBase::Map* map);
		virtual osg::ref_ptr<CoreBase::ActorBase> clone();
		void setVertex(QString vertex);
		QString getVertex();
		void setVertex(const osg::Vec3&  minvec3,const osg::Vec3& maxvec3);
		void getVertex(osg::Vec3&  minvec3,osg::Vec3& maxvec3);
	};
}